package com.ctshk.sapp.insurance.controller;


import com.ctshk.common.dto.Result;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.insurance.req.tp.PriceReq;
import com.ctshk.rpc.insurance.req.tp.UnitPriceReq;
import com.ctshk.rpc.insurance.service.IInsuranceCostService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * <p>
 * 保险价格成本 前端控制器
 * </p>
 *
 * @author wangcy
 * @since 2021-01-26
 */
@Api(value="保险产品报价", tags="保险产品报价")
@RestController
@RequestMapping("/insurance-cost")
public class InsuranceCostController extends BaseController {

    @DubboReference
    private IInsuranceCostService iInsuranceCostService;

    @ApiOperation(value = "保险承保价格", notes = "保险承保价格")
    @PostMapping(value = "query-price")
    public Result queryPrice(@RequestBody List<PriceReq> priceReq){
        return iInsuranceCostService.queryPrice(priceReq);
    }

    @ApiOperation(value = "保险承保单价价格", notes = "保险承保单价价格")
    @PostMapping(value = "query-unit-price")
    public Result queryUnitPrice(@RequestBody UnitPriceReq unitPriceReq) {

        return iInsuranceCostService.queryUnitPrice(unitPriceReq);
    }

}
